<?php

//require_once 'Zend/View/Helper/HtmlElement.php';

class My_View_Helper_Img extends Zend_View_Helper_HtmlElement {

    /**
     *
     * @param string $src
     * @param string $alt
     * @param array|string $attribs
     * @return string 
     */
    public function img($src, $alt = '', $attribs = null)
    {
        $src = $this->view->baseUrl($src);

        if (is_array($attribs)) {
            $attribs = $this->_htmlAttribs($attribs);
        } else {
            $attribs = empty($attribs) ? '' : ' '.$attribs;
        }

        $alt = $this->view->escape($alt);

        $xhtml = '<img '
                . 'src="'.$src.'" '
                . 'title="'.$alt.'" '
                . 'alt="'.$alt.'"'
                . $attribs
                . $this->getClosingBracket();

        return $xhtml;
    }

}